QuickTime 3 Reference

| Previous | Chapter Contents | Chapter Top | Next |

Drawing Images

GraphicsImportSetGWorld

Sets the graphics port and device for drawing.

extern pascal ComponentResult GraphicsImportSetGWorld (
    GraphicsImportComponent ci,
    CGrafPtr port,
    GDHandle gd);

ci     Specifies the component instance that identifies your connection to the graphics importer component.

port     Specifies the destination graphics port or graphics world. Set to nil to use the current port.

gd     Specifies the destination graphics device. Set to nil to use the current device. If the port parameter specifies a graphics world, set this parameter to nil to use that graphics world's device.

DISCUSSION

The graphics world is initialized to the current port and device when the graphics importer component is opened. You can use this function to select another port or device.

RESULT CODES
noErr
0 No error
paramErr
-50 Invalid parameter specified
memFullErr
-108 Not enough memory available

GraphicsImportGetGWorld

Returns the current graphics port and device for drawing.

extern pascal ComponentResult GraphicsImportGetGWorld (
    GraphicsImportComponent ci,
    CGrafPtr *port,
    GDHandle *gd);

ci     Specifies the component instance that identifies your connection to the graphics importer component.

port     Returns the current destination graphics port. Set to nil if you are not interested in this information.

gd     Returns the destination graphics device. Set to nil if you are not interested in this information.

DISCUSSION

This function returns the graphics port and device that will be used to draw the image. The graphics world is initialized to the current port and device when the graphics importer component is opened.

RESULT CODES
noErr
0 No error
paramErr
-50 Invalid parameter specified
memFullErr
-108 Not enough memory available

GraphicsImportDraw

Draws an image.

extern pascal ComponentResult GraphicsImportDraw (GraphicsImportComponent ci);

ci     Specifies the component instance that identifies your connection to the graphics importer component.

DISCUSSION

This function draws the image currently in use by the grapics importer component to the graphics port and device specified by the GraphicsImportSetGWorld function. The GraphicsImportDraw function takes into account all settings you have specified for the image, such as the source rectangle, clipping region, graphics mode, and image quality.

The generic graphics importer's Draw function uses the results of GetImageDescription and GetDataOffsetAndSize to create a decompression sequence and uses it to draw the image. Other graphics importers may override this behavior.

RESULT CODES
noErr
0 No error
paramErr
-50 Invalid parameter specified
memFullErr
-108 Not enough memory available

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |